<?php $this->load->view('sys_header');?>


<div class="nav">
    <h2><a href="#">TAYCMS后台管理</a> > <a href="<?php echo made_admin_url('main/mainfra');?>">首页</a>  > <a href="#">碎片代码设置</a></h2>
</div>


<script type="text/javascript">


    $(function(){



    });

    function checkform()
    {
        chipname = $('.chipname');

        for(i=1;i<chipname.length;i++)
        {
            if(chipname[i].value == ''){
                lin.msg('碎片代码名称不能为空!');
                return false;
            }
        }




    }







</script>

<div class="contenter" >
    <div class="itemtitle"><h3>碎片代码设置</h3></div>
    <div class="ml"></div>
    <div>碎片使用方法：在模板中调用 格式如： {chips('碎片名')} ,碎片名请使用英文，否则会出错！
        <br>
        碎片删除方法：将碎片内容设置为空，即可删除该碎片。
    </div>
    <div class="ml"></div>
    <form name="cpform" method="post" autocomplete="off" action="<?php echo made_admin_url('chips');?>"  id="cpform" onsubmit="return checkform();" >

        <table  width="100%" border="0" align="left" cellpadding="0" cellspacing="0" >
            <TR>
                <TD width="100%">



                    <?php foreach ($list as $value):?>
                    <table width="95%" border="0" align="center" cellpadding="3" cellspacing="0"  >
                        <tr>
                            <td width="12%" height="25">碎片名：</td>
                            <td width="88%"><label>
                                <input type="text" name="chipname[<?php echo $value['id']?>]" id="chipname<?php echo $value['id']?>" class="border chipname" value="<?php echo $value['chipname']?>" size="20" />
                            </label></td>
                        </tr>

                        <tr>
                            <td>信息内容：</td>
                            <td><label>
                                <textarea id="content<?php echo $value['id']?>" name="content[<?php echo $value['id']?>]" class="border" style="width:400px;height:100px;"><?php echo $value['content']?></textarea>
                            </label>
                            </td>
                        </tr>

                    </table>

                    <?php endforeach;?>




                    <table width="95%" border="0" align="center" cellpadding="3" cellspacing="0"  >
                        <tr>
                            <td width="12%" height="25">碎片名：</td>
                            <td width="88%"><label>
                                <input type="text" name="new_chipname" id="new_chipname" class="border" size="20" />
                            </label></td>
                        </tr>

                        <tr>
                            <td>信息内容：</td>
                            <td><label>
                                <textarea id="new_content" name="new_content" class="border" style="width:400px;height:100px;"></textarea>
                            </label>
                            </td>
                        </tr>

                    </table>

                </TD>
            </TR>
            <tr>
                <td height="25" colspan="2" align="center"><label>
                    <input name="submit" type="submit" id="submit" value="提交"   class="sub_btn" />
                </label></td>
            </tr>
        </table>


    </form>



</div>


<div class="clear"></div>


<?php $this->load->view('sys_footer');?>